
function toggleHistory() {
	var history = $('history');
	var toggler = $('history_toggler');

	if(toggler.getText() == 'show') {
		toggler.getText() = 'hide';
		history.setStyle('display', '');
	}
	else {
		toggler.getText() = 'show';
		history.setStyle('display', 'none');
	}
}

function editPreview(content, update) {
	return new Ajax('?preview', {
		method: 'post',
		data: {content: content},
		update: update
	}).request();
}

function editSubmitted(form) {
	$(form).getElementsBySelector('input[type=submit]').forEach(function(submit) {
		submit.disabled = true;
	});
}
